<?php
$page_title="Manage News & Events ";
include("includes/header.php");

$news_id=$_GET["news_id"];
$query = "SELECT * FROM bkit_news where news_id=".$news_id;
$mode=$_GET["mode"];


if($mode=="edit") 	$news_info=@array_pop(qry_data("select * from bkit_news where news_id=".$news_id));
if($mode=="del"){
	exec_qry("update bkit_news set rec_status=0 where news_id=".$news_id);//Soft Delete
	header("location:news_list.php");
}
?>				
<div class="fleft">
<ul class="subMenu">
<li><a href="edit_news.php?mode=add">Add New </a></li>
<li><a href="news_list.php?mode=result">Back to News List </a></li>
</ul>
</div>
<div class="cleardiv"></div>
	<div style="width:100%" class="content_bg">
	<form method="post" action="edit_news_pro.php?news_id=<?=$_GET["news_id"]?>" > 
		<table class="voip_form" width="600"  cellpadding="8" border="0" cellspacing="3"> 
			<tr>
				<td  height="10" style="padding:2px;margin:2px" colspan="2" align="right"><small style="font-size:11px"> <i><?=ast()?>  Required fields.</i></small></td>
			</tr>
			<tr >
				<td width="250" class="frmLabel">News / Event  Title <?=ast()?></td>
				<td > <input type="text" class="txtbox"  name="news_title" size="60" value="<?=$news_info["news_title"]?>"> </td>
			</tr>
			<tr>
				<td class="frmLabel"> Content Type <?=ast()?></td>
				<td>
					<input type="radio"  onclick="if(this.checked) $('dvEventSection').hide(); else $('dvEventSection').show();"  name="news_type" value="0" id="rdNews" <?if($news_info["news_type"]==0) echo "checked"; ?>> <label for="rdNews">News</label>
					<input type="radio"  onclick="if(this.checked) $('dvEventSection').show(); else $('dvEventSection').hide();"  name="news_type"  value="1" id="rdEvent" <?if($news_info["news_type"]==1) echo "checked"; ?>><label for="rdEvent">Event</label> 
				</td>
			</tr>
			<tr>
				<td colspan="2">
			<div id="dvEventSection" <?if($news_info["news_type"]==0) {?> style="display:none" <?}?> >
			<table width="100%" >
			<tr>
				<td width="260" class="frmLabel">Event Date <?=ast()?></td>
				<td > 
				
					<script language="javascript">
					<?
						if($news_info["news_date"]=="") 
							echo "DateInput('news_date', true, 'YYYY-MM-DD')";
						else
							echo "DateInput('news_date', true, 'YYYY-MM-DD','".$news_info['news_date']."')";
					?>
					</script>
				
				</td>
			</tr>
			<tr >
				<td  class="frmLabel">Event Location City <?=ast()?></td>
				<td> <input type="text" class="txtbox"  name="event_city" size="60" value="<?=$news_info["event_city"]?>"> </td>
			</tr>
			<tr >
				<td  class="frmLabel" valign="top">Event Location Address <?=ast()?></td>
				<td > <textarea class="txtarea"   rows="5" cols="70"  name="event_address" ><?=$news_info["event_address"]?></textarea> </td></td>
			</tr>
			<tr >
				<td  class="frmLabel">Event Registration Notification Email  <?=ast()?></td>
				<td > <input type="text" class="txtbox"  name="event_admin_email" size="60" value="<?=$news_info["event_admin_email"]?>"><span class="note"><br/>Admin notification email id(s) separated by ","</span> </td>
			</tr>
			</table>
			</div>
			</td>
			</tr>
			
			
			<tr>
				<td class="frmLabel" valign="top" colspan="2"> Content <?=ast()?><br/><br/>
				 <textarea class="txtarea"  id="news_content" rows="14" cols="90" name="news_content" style="width:800px;height:400px;"><?=$news_info["news_content"]?></textarea> </td>
			</tr>
			<tr>
			<td class="frmLabel">Show in Front End </td>
			<td>
				<input type="radio"   name="rec_status" value="1" id="rdShow" <?if($news_info["rec_status"]==1) echo "checked"; ?>> <label for="rdShow">Yes</label>
				<input type="radio"   name="rec_status"  value="2" id="rdHide" <?if($news_info["rec_status"]==2) echo "checked"; ?>><label for="rdHide">No</label> 
			</td>
			</tr>
			
	
			<tr bgcolor="#fff" style="height:50px;margin:0px;padding:0px;">
				
				<td  style="margin:0px;padding:2px;" align="right" colspan="2">
				<input type="submit" class="button"  value="Save Info">&nbsp;
				<input class="button" type="reset">
				<input onclick="location.href='news_list.php'"  type="button" class="button" value=" Back to News & Events List">
				</td>
			</tr>
			
		</table>
	</form>
</div>

<div style="margin-bottom:40px">

</div>
<link rel="stylesheet" href="includes/wysiwyg.css" type="text/css">
<script type="text/javascript" src="includes/scripts/wysiwyg.js"></script>
<script type="text/javascript" src="includes/scripts/wysiwyg-settings.js"></script>
		<!-- 
			Attach the editor on the textareas
		-->
		<script type="text/javascript">
			
			// Use it to attach the editor directly to a defined textarea
			WYSIWYG.attach('news_content'); // default setup
			
		</script>

<? include("includes/footer.php");?>
